package com.oodso.sell.model;

import android.content.Context;
import android.text.TextUtils;
import android.util.Log;

import com.oodso.sell.SellApplication;
import com.oodso.sell.model.bean.AboutInfo;
import com.oodso.sell.model.bean.AddGoodsCategoryBean;
import com.oodso.sell.model.bean.AddStoreBean;
import com.oodso.sell.model.bean.AddWarehouseBean;
import com.oodso.sell.model.bean.AddressDetailBean;
import com.oodso.sell.model.bean.AliPayResponse;
import com.oodso.sell.model.bean.AppToH5Bean;
import com.oodso.sell.model.bean.AreaResponseBean;
import com.oodso.sell.model.bean.AritcleDetailBean;
import com.oodso.sell.model.bean.ArticleListBean;
import com.oodso.sell.model.bean.BankCardInfoBean;
import com.oodso.sell.model.bean.BankCardListBean;
import com.oodso.sell.model.bean.BankListBean;
import com.oodso.sell.model.bean.BooleanResultBean;
import com.oodso.sell.model.bean.ChildIdDetailBean;
import com.oodso.sell.model.bean.ChildListBean;
import com.oodso.sell.model.bean.CompaniesBean;
import com.oodso.sell.model.bean.CouponDetailBean;
import com.oodso.sell.model.bean.CouponListBean;
import com.oodso.sell.model.bean.CouponUseBean;
import com.oodso.sell.model.bean.DeleteStoreBean;
import com.oodso.sell.model.bean.DepositListBean;
import com.oodso.sell.model.bean.DepositMoneyType;
import com.oodso.sell.model.bean.DespositBean;
import com.oodso.sell.model.bean.ElementBean;
import com.oodso.sell.model.bean.ExpressBean;
import com.oodso.sell.model.bean.FinancilaRecordList;
import com.oodso.sell.model.bean.FreightTempBean;
import com.oodso.sell.model.bean.GetDefaultShopidBean;
import com.oodso.sell.model.bean.GetEvaluatesBean;
import com.oodso.sell.model.bean.GetImTokenBean;
import com.oodso.sell.model.bean.GetRewardListBean;
import com.oodso.sell.model.bean.GoodsAddBean;
import com.oodso.sell.model.bean.GoodsListBean;
import com.oodso.sell.model.bean.GoodsPromotionBean;
import com.oodso.sell.model.bean.GoodsRefundBean;
import com.oodso.sell.model.bean.GoodsRefundResultBean;
import com.oodso.sell.model.bean.GoodsSoldOutBean;
import com.oodso.sell.model.bean.GroupDetailBean;
import com.oodso.sell.model.bean.GroupItemBean;
import com.oodso.sell.model.bean.H5URLBean;
import com.oodso.sell.model.bean.ItemCatDetaileBean;
import com.oodso.sell.model.bean.ItemsCatsBean;
import com.oodso.sell.model.bean.LeaseGoodsInfoBean;
import com.oodso.sell.model.bean.LeaseOrderCostBean;
import com.oodso.sell.model.bean.LeaseOrderInfoBean;
import com.oodso.sell.model.bean.MoneyTypeBean;
import com.oodso.sell.model.bean.MyAddressBean;
import com.oodso.sell.model.bean.NewAuthInfoBean;
import com.oodso.sell.model.bean.NumberReponseBean;
import com.oodso.sell.model.bean.OrderDeliverResultBean;
import com.oodso.sell.model.bean.OrderDetailsBean;
import com.oodso.sell.model.bean.OrderRefundListBean;
import com.oodso.sell.model.bean.PackResponse;
import com.oodso.sell.model.bean.PayAccountInfoBean;
import com.oodso.sell.model.bean.PaymentMoneyListBean;
import com.oodso.sell.model.bean.PlatformBean;
import com.oodso.sell.model.bean.PlatformListBean;
import com.oodso.sell.model.bean.PlatformSercetBean;
import com.oodso.sell.model.bean.RefundCountBean;
import com.oodso.sell.model.bean.RefundDetailsBean;
import com.oodso.sell.model.bean.RewardBean;
import com.oodso.sell.model.bean.RewardDetailBean;
import com.oodso.sell.model.bean.RongyunResponse;
import com.oodso.sell.model.bean.SalesOrderBean;
import com.oodso.sell.model.bean.SearchMainItemCateBean;
import com.oodso.sell.model.bean.SellerOrdersBean;
import com.oodso.sell.model.bean.SellerRefundsListBean;
import com.oodso.sell.model.bean.ShopConfirmBean;
import com.oodso.sell.model.bean.ShopFinancialBean;
import com.oodso.sell.model.bean.ShopFirstBean;
import com.oodso.sell.model.bean.ShopInfoBeans;
import com.oodso.sell.model.bean.ShopListBean;
import com.oodso.sell.model.bean.ShopUniquesellerIdBean;
import com.oodso.sell.model.bean.StoreBannerBean;
import com.oodso.sell.model.bean.StoreDetailBean;
import com.oodso.sell.model.bean.StoreFunctionMenuInfoBean;
import com.oodso.sell.model.bean.StoreListBean;
import com.oodso.sell.model.bean.SubjectDataBean;
import com.oodso.sell.model.bean.SubletListBean;
import com.oodso.sell.model.bean.SummaryDataBean;
import com.oodso.sell.model.bean.TakeMoneyBean;
import com.oodso.sell.model.bean.TimeLimitDetailBean;
import com.oodso.sell.model.bean.TimeLimitListBean;
import com.oodso.sell.model.bean.TradesInfoBean;
import com.oodso.sell.model.bean.UpdateGoodBean;
import com.oodso.sell.model.bean.UpdateStoreBean;
import com.oodso.sell.model.bean.UserResponse;
import com.oodso.sell.model.bean.WareHouseBean;
import com.oodso.sell.model.bean.WebSettingBean;
import com.oodso.sell.model.bean.WeixinPayResponse;
import com.oodso.sell.model.util.HttpConstans;
import com.oodso.sell.model.util.TransformUtils;
import com.oodso.sell.utils.AESOperatorUtil;
import com.oodso.sell.utils.Constant;
import com.oodso.sell.utils.DateUtil;
import com.oodso.sell.utils.DeviceInfoUtils;
import com.oodso.sell.utils.NetUtil;

import rx.Observable;


/**
 * 项目名称：ConsumSoStroe
 * 类描述：
 * 创建人：资拥
 * 创建时间：16/10/27 下午3:17
 * 修改人：资拥
 * 修改时间：16/10/27 下午3:17
 * 修改备注：
 */
public class StringHttp extends HttpConstans<String> {


    protected SellApi mSellApi = null;
    protected AppToH5Api mAppToH5lApi;
    protected MySellApi mMySellApi;
    private static Context mContext;
    private final SellApi1310 sellApi1310;

    private StringHttp() {
        mSellApi = SellHttp.getInstance().getSellApi();
        mAppToH5lApi = SellHttp.getInstance().getAppToH5lApi();
        mMySellApi = SellHttp.getInstance().getMySellApi();
        sellApi1310 = SellHttp.getInstance().getSellApi1310();
    }


    private static class SingletonHolder {
        static StringHttp mHelpUtil = new StringHttp();
    }


    public static StringHttp getInstance() {
        return StringHttp.SingletonHolder.mHelpUtil;
    }

    public static StringHttp getInstance(Context context) {
        mContext = context;
        return StringHttp.SingletonHolder.mHelpUtil;
    }


    /**
     * 用户名密码登录
     *
     * @param userName 手机号
     * @param pwd      密码
     */
    public Observable<UserResponse> userLogin(String userName, String pwd) {
        String encrypt = "";
        try {
            encrypt = AESOperatorUtil.getInstance().encrypt(pwd);
            encrypt = encrypt.replace('+', '*').replace('/', '-').replace('=', '.');
        } catch (Exception e) {
            Log.e("AES Password", e.toString());
        }
        return mSellApi.userLogin(USER_LOGIN, userName, encrypt, "1", DeviceInfoUtils.getClientInfo(), DeviceInfoUtils.getDeviceId())
                .compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 手机号快捷登录
     *
     * @param phoneNumber       手机号
     * @param vertificationCode 验证码
     */
    public Observable<UserResponse> userPwdLogin(String phoneNumber, String vertificationCode) {
        return mSellApi.turnToMobilePhoneLogin(USER_PWD_LOGIN, phoneNumber, vertificationCode, "1", DeviceInfoUtils.getClientInfo(), DeviceInfoUtils.getDeviceId()).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 获取验证码（手机快捷登录）
     *
     * @param phoneNumber 手机号
     * @param companyid   需要调用的公司短信通道，不填则使用平台方，用户输入有效的公司ID。
     */
    public Observable<UserResponse> getVerifyCodeOfMobileLogin(String phoneNumber, String companyid) {
        return mSellApi.getVerifyCodeOfMobileLogin(URL_GETVERIFYCODEOFMOBILELOGIN, phoneNumber, companyid).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }


    public Observable<UserResponse> getRegisterUser(String phone, String vertificationCode, String password) {
        String encryptPwd = null;
        try {
            String encrypt = AESOperatorUtil.getInstance().encrypt(password);
            encryptPwd = encrypt.replace('+', '*').replace('/', '-')
                    .replace('=', '.');
        } catch (Exception e) {
            e.printStackTrace();
        }
        return mSellApi.getRegisterUser(URL_MOBILEPHONE_REGISTER, NetUtil
                .getLocalIpAddress(mContext), phone, vertificationCode, encryptPwd, "").compose(TransformUtils.<UserResponse>defaultSchedulers());
    }


    public Observable<PackResponse> turntoIsRegister(String phone) {
        return mSellApi.turnToGetIsRegister(URL_IS_REGISTER, phone, "1").compose(TransformUtils.<PackResponse>defaultSchedulers());
    }


    /**
     * 获取用户信息
     *
     * @param nick   昵称
     * @param userId 用户ID
     */
    public Observable<UserResponse> getUserInfo(String nick, String userId) {
        return mSellApi.getUserInfomation(URL_GETUSERINFO, nick, userId).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 获取验证码（绑定邮箱/解绑邮箱/绑定手机/解绑手机）
     *
     * @param phoneNumber 手机号/邮箱
     * @param sendtype    发送类型 EMAIL/SMS
     * @param actionname  操作动作
     */
    public Observable<UserResponse> getVerifyCode(String phoneNumber, String sendtype, String actionname) {
        return mSellApi.getVerifyCode(URL_GETVERIFYCODE, sendtype, phoneNumber, actionname, "", "false").compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 查询验证码
     *
     * @param code     验证码
     * @param userflag 用户标识
     */
    public Observable<UserResponse> InquiryVerifyCode(String code, String userflag) {
        return mSellApi.InquiryVerifyCode(URL_INQUIRY_VERIFYCODE, code, userflag).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 修改个人信息
     */
    public Observable<UserResponse> turnToModifyPhone(int ismale, String name, String avatar) {
        if (TextUtils.isEmpty(avatar)) {
            return mMySellApi.turnToModifyPhone(URL_MODIFY_USERINFO, ismale, 30, "", "", name).compose(TransformUtils.<UserResponse>defaultSchedulers());
        } else
            return mMySellApi.turnToModifyPhone(URL_MODIFY_USERINFO, ismale, 30, "", "", name, avatar).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 修改个人信息 --昵称
     */
    public Observable<UserResponse> turnToModifyPhone(String name) {
        return mMySellApi.turnToModifyname(URL_MODIFY_USERINFO, name).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 修改个人信息 -- 地址
     */
    public Observable<UserResponse> turnToModifyAddress(String province, String city, String address) {
        return mMySellApi.turnToModifyAddress(URL_MODIFY_USERINFO, province, city, address).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 验证登录信息
     */
    public Observable<UserResponse> getAuth() {
        return mSellApi.getAuth(USER_AUTH).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 设置密码
     *
     * @param newPwd 新密码
     * @param phone  手机号
     * @param code   验证码
     */
    public Observable<UserResponse> turnToRetrievePwd(String newPwd, String phone, String code) {
        String encryptPwd = "";
        try {
            String encrypt = AESOperatorUtil.getInstance().encrypt(newPwd);
            encryptPwd = encrypt.replace('+', '*').replace('/', '-').replace('=', '.');
        } catch (Exception e) {
            e.printStackTrace();
        }
        return mSellApi.turnToRetrievePwd(URL_RETRIEVEPWD, encryptPwd, code, phone).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 修改密码
     *
     * @param password    原密码
     * @param newpassword 新密码
     */
    public Observable<UserResponse> turnToModifyPwd(String password, String newpassword) {
        String encryptPwd = "";
        String newencryptPwd = "";
        try {
            String encrypt = AESOperatorUtil.getInstance().encrypt(password);
            String newencrypt = AESOperatorUtil.getInstance().encrypt(newpassword);
            newencryptPwd = newencrypt.replace('+', '*').replace('/', '-').replace('=', '.');
            encryptPwd = encrypt.replace('+', '*').replace('/', '-').replace('=', '.');
        } catch (Exception e) {
            e.printStackTrace();
        }
        return mMySellApi.turnToModifyPwd(URL_MODIFYPWD, encryptPwd, newencryptPwd).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }


    /**
     * 申请实名认证
     *
     * @param authenticationname   认证名字
     * @param idcard               身份证号码
     * @param positiveidentitycard 身份证正面
     * @param backofidcard         身份证背面
     * @param idcardhandheld       身份证手持
     */
    public Observable<UserResponse> bodyAuthenticationApply(String authenticationname, String idcard, String positiveidentitycard, String backofidcard, String idcardhandheld) {
        return mSellApi.bodyAuthenticationApply(URL_BODY_AUTHENTICATION_APPLY, authenticationname, idcard, positiveidentitycard, backofidcard, idcardhandheld).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }


    /**
     * 获取商品列表
     *
     * @param pagenum   页码
     * @param pagesize  每页的展示条目的数量
     * @param itemstate 商品状态
     * @param isdelete  是否已删除
     */
    public Observable<GoodsListBean> getGoodsList(String pagenum, String pagesize, String itemstate, String isdelete, String type) {
        return mSellApi.getGoodsList(GOOD_GETGOODSSORT, pagenum, pagesize, itemstate, isdelete, type, SellApplication.getInstance().getShopId(), "true").compose(TransformUtils.<GoodsListBean>defaultSchedulers());
    }

    /**
     * 根据id集合  获取商品列表
     *
     * @param pagenum  页码
     * @param pagesize 每页的展示条目的数量
     */
    public Observable<GoodsListBean> getGoodsList(String pagenum, String pagesize, String ids) {
        return mSellApi.getidsGoodsList(GOOD_GETGOODSSORT, pagenum, pagesize, SellApplication.getInstance().getShopId(), ids).compose(TransformUtils.<GoodsListBean>defaultSchedulers());
    }

    /**
     * 获取商品列表
     * 返回参加过什么活动
     *
     * @param pagenum   页码
     * @param pagesize  每页的展示条目的数量
     * @param itemstate 商品状态
     * @param isdelete  是否已删除
     */
    public Observable<GoodsListBean> getActionGoodsList(String pagenum, String pagesize, String itemstate, String isdelete, String type) {
        return mSellApi.getGoodsList(GOOD_GETGOODSSORT, pagenum, pagesize, itemstate, isdelete, type, SellApplication.getInstance().getShopId(), "true", "true").compose(TransformUtils.<GoodsListBean>defaultSchedulers());
    }

    public Observable<GoodsListBean> getItemTitleGoodsList(String pagenum, String pagesize, String itemtitle, String isdelete, String type) {
        return mSellApi.getitemtitleGoodsList(GOOD_GETGOODSSORT, pagenum, pagesize, itemtitle, isdelete, type, SellApplication.getInstance().getShopId(), "true").compose(TransformUtils.<GoodsListBean>defaultSchedulers());
    }

    public Observable<GoodsListBean> getCouponGoodsList(String ids, String pagenum, String pagesize) {
        return mSellApi.getCouponGoodsList(GOOD_GETGOODSSORT, ids, pagenum, pagesize).compose(TransformUtils.<GoodsListBean>defaultSchedulers());
    }

    /**
     * 通过id获得商品
     *
     * @param ids
     * @return
     */
    public Observable<GoodsListBean> getGoodsById(String pagenum, String pagesize, String ids) {
        return mSellApi.getGoodsById(GOOD_GETGOODSSORT, pagenum, pagesize, ids).compose(TransformUtils.<GoodsListBean>defaultSchedulers());
    }

    public Observable<GoodsListBean> getDetailbyId(String ids) {
        return mSellApi.getGoodsDetailById(GOOD_GETDETAILBYID, ids,"true").compose(TransformUtils.<GoodsListBean>defaultSchedulers());
    }


    /**
     * 通过运费模板id获取商品列表
     *
     * @param pagenum             页码
     * @param pagesize            页容量
     * @param logisticstemplateid 运费模板id
     * @param isdelete            是否删除
     * @param itemstate           条目状态
     * @return
     */
    public Observable<GoodsListBean> getGoodsNum(String pagenum, String pagesize, String logisticstemplateid, String isdelete, String itemstate) {
        return mSellApi.getGoodsNum(GOOD_GETGOODSSORT, pagenum, pagesize, logisticstemplateid, isdelete, itemstate, SellApplication.getInstance().getShopId(),"true").compose(TransformUtils.<GoodsListBean>defaultSchedulers());
    }
    public Observable<GoodsListBean> getGoodsNum(String pagenum, String pagesize, String logisticstemplateid, String isdelete) {
        return mSellApi.getGoodsNum(GOOD_GETGOODSSORT, pagenum, pagesize, logisticstemplateid, isdelete, SellApplication.getInstance().getShopId(),"true").compose(TransformUtils.<GoodsListBean>defaultSchedulers());
    }

    /**
     * 商品下架
     *
     * @param itemids 商品id
     */
    public Observable<GoodsSoldOutBean> goodsOffShelf(String itemids) {
        return mSellApi.goodsOffShelf(GOOD_OFFSHELF, itemids).compose(TransformUtils.<GoodsSoldOutBean>defaultSchedulers());

    }

    /**
     * 商品上架
     *
     * @param itemid 商品id
     */
    public Observable<GoodsSoldOutBean> goodsOnShelf(String itemid) {
        return mSellApi.goodsOnShelf(GOOD_ONSHELF, itemid).compose(TransformUtils.<GoodsSoldOutBean>defaultSchedulers());

    }

    /**
     * 商品删除
     *
     * @param itemid 商品id
     */
    public Observable<GoodsSoldOutBean> goodsDelete(String itemid) {
        return mSellApi.goodsDelete(GOOD_DELETE, itemid).compose(TransformUtils.<GoodsSoldOutBean>defaultSchedulers());

    }

    /**
     * 商品推荐状态修改
     *
     * @param statecode 状态码
     * @param itemid    商品id
     * @return
     */
    public Observable<BooleanResultBean> goodsStateModify(String statecode, String itemid) {
        return mSellApi.goodsStateModify(GOOD_STATE_MODIFY, statecode, itemid).compose(TransformUtils.<BooleanResultBean>defaultSchedulers());
    }

    public Observable<NumberReponseBean> changeFreightTemp(String ItemIds, String LogisticsTemplateId) {
        return mSellApi.changeFreightTemp(GOOD_FREIGHTTEMP_CHANGE, ItemIds, LogisticsTemplateId).compose(TransformUtils.<NumberReponseBean>defaultSchedulers());
    }

    /**
     * 添加商品
     *
     * @param itemtitle         商品名称
     * @param pictures          展示在轮播
     * @param mobileDetaile     展示在详情
     * @param subtitle          商品描述
     * @param marketprice       市场价
     * @param price             售价
     * @param stock             库存
     * @param customspecnames   型号标志
     * @param jsoncustomskus    sku
     * @param offShelfTime      下架时间
     * @param itemcatid         主营类目
     * @param shopcatids        店铺分类
     * @param onshelftype       1.立即 2.库存 3.定时
     * @param isrecommend       是否是店长推荐
     * @param inventorycount    库存减少方式
     * @param integrallimit     积分限制
     * @param integral_quantity 钱脚忙数量
     */
    public Observable<GoodsAddBean> addGoods(String itemtitle, String pictures, String mobileDetaile, String subtitle, String marketprice, String price,
                                             String stock, String customspecnames, String jsoncustomskus, String onshelftype, String itemcatid,
                                             String shopcatids, String isrecommend, String offShelfTime, String integrallimit, String inventorycount,
                                             String integral_quantity, String freighttemplateid, String integralcurrency, String ext, String type,
                                             String coordinate, String itemparts, String restrictedapp, String allow_app_ids, String ids, String out_url, String is_support_reservation, String reservation_msg,
                                             String support_shopping_cart, String instructions, String virtual_sales, String is_distribution, String audit_state,
                                             String itempropvalues, String item_code, String stagepayment, String customer_option, String disabled_buy,
                                             String onshelftime) {

        if (customer_option != null) {


            return mSellApi.addGoods(GOOD_ADD, itemtitle, pictures,
                    mobileDetaile, subtitle, marketprice, price, stock, customspecnames,
                    jsoncustomskus, itemcatid, shopcatids, isrecommend, offShelfTime, onshelftype,
                    integrallimit, inventorycount, SellApplication.getInstance().getShopId(), integral_quantity,
                    freighttemplateid, integralcurrency, ext, type, coordinate, itemparts, restrictedapp, allow_app_ids, ids, out_url, is_support_reservation,
                    reservation_msg, support_shopping_cart, instructions, virtual_sales, is_distribution, "", audit_state, itempropvalues, item_code, stagepayment,
                    customer_option, disabled_buy, onshelftime).compose(TransformUtils.<GoodsAddBean>defaultSchedulers());
        } else
            return mSellApi.addNocoutomerGoods(GOOD_ADD, itemtitle, pictures,
                    mobileDetaile, subtitle, marketprice, price, stock, customspecnames,
                    jsoncustomskus, itemcatid, shopcatids, isrecommend, offShelfTime, onshelftype,
                    integrallimit, inventorycount, SellApplication.getInstance().getShopId(), integral_quantity,
                    freighttemplateid, integralcurrency, ext, type, coordinate, itemparts, restrictedapp, allow_app_ids, ids, out_url, is_support_reservation,
                    reservation_msg, support_shopping_cart, instructions, virtual_sales, is_distribution, "", audit_state, itempropvalues, item_code, stagepayment, disabled_buy).compose(TransformUtils.<GoodsAddBean>defaultSchedulers());
    }

    /**
     * 添加商品
     *
     * @param itemtitle              商品名称
     * @param pictures               展示在轮播
     * @param mobileDetaile          展示在详情
     * @param subtitle               商品描述
     * @param marketprice            市场价
     * @param price                  售价
     * @param stock                  库存
     * @param customspecnames        型号标志
     * @param jsoncustomskus         sku
     * @param offShelfTime           下架时间
     * @param itemcatid              主营类目
     * @param shopcatids             店铺分类
     * @param onshelftype            1.立即 2.库存 3.定时
     * @param isrecommend            是否是店长推荐
     * @param inventorycount         库存减少方式
     * @param integrallimit          积分限制
     * @param integral_quantity      钱脚忙数量
     * @param distributiontemplateid 转租提成模板id
     */
    public Observable<GoodsAddBean> addLeaseGoods(String itemtitle, String pictures, String mobileDetaile, String subtitle, String marketprice, String price,
                                                  String stock, String customspecnames, String jsoncustomskus, String onshelftype, String itemcatid,
                                                  String shopcatids, String isrecommend, String offShelfTime, String integrallimit, String inventorycount,
                                                  String integral_quantity, String freighttemplateid, String integralcurrency, String ext, String type,
                                                  String coordinate, String itemparts, String distributiontemplateid, String restrictedapp, String allow_app_ids, String ids, String out_url, String is_support_reservation, String reservation_msg,
                                                  String support_shopping_cart, String instructions, String virtual_sales, String is_distribution, String audit_state, String itempropvalues, String item_code,
                                                  String onshelftime) {
        return mSellApi.addLeaseGoods(GOOD_ADD, itemtitle, pictures,
                mobileDetaile, subtitle, marketprice, price, stock, customspecnames,
                jsoncustomskus, itemcatid, shopcatids, isrecommend, offShelfTime, onshelftype,
                integrallimit, inventorycount, SellApplication.getInstance().getShopId(), integral_quantity,
                freighttemplateid, integralcurrency, ext, type, coordinate, itemparts, restrictedapp, allow_app_ids, ids, out_url, is_support_reservation,
                reservation_msg, support_shopping_cart, instructions, virtual_sales, is_distribution, distributiontemplateid, audit_state, itempropvalues, item_code,onshelftime).compose(TransformUtils.<GoodsAddBean>defaultSchedulers());

    }


    /**
     * 更新商品--------------lease
     *
     * @param itemid                 商品id
     * @param itemtitle              商品名称
     * @param pictures               展示在轮播
     * @param mobileDetaile          展示在详情
     * @param subtitle               商品描述
     * @param marketprice            市场价
     * @param price                  售价
     * @param stock                  库存
     * @param customspecnames        自定义属性名
     * @param jsoncustomskus         商品sku
     * @param itemcatid              主营类目
     * @param shopcatids             店铺分类
     * @param onshelftype            1.立即 2.库存 3.定时
     * @param isrecommend            是否是店长推荐
     * @param inventorycount         库存减少方式
     * @param integrallimit          积分限制
     * @param integral_quantity      钱脚忙数量
     * @param distributiontemplateid 转租提成模板id
     */
    public Observable<UpdateGoodBean> updateLeaseGoods(String itemid, String itemtitle, String pictures, String mobileDetaile, String subtitle,
                                                       String marketprice, String price, String stock, String customspecnames, String jsoncustomskus,
                                                       String onshelftype, String itemcatid, String shopcatids, String isrecommend, String integrallimit,
                                                       String inventorycount, String integral_quantity, String freighttemplateid, String integrakcyrency,
                                                       String ext, String type, String coordinate, String itemparts, String distributiontemplateid, String restrictedapp, String allow_app_ids, String ids,
                                                       String out_url, String is_support_reservation, String reservation_msg,
                                                       String support_shopping_cart, String instructions, String virtual_sales, String is_distribution, String itempropvalues, String item_code, String onshelftime) {
        return mSellApi.updateleaseGoods(GOOD_UPDATE, itemid, itemtitle, pictures, mobileDetaile, subtitle, marketprice, price, stock, customspecnames,
                jsoncustomskus, itemcatid, shopcatids, isrecommend, onshelftype, integrallimit, inventorycount,
                SellApplication.getInstance().getShopId(), integral_quantity, freighttemplateid, integrakcyrency, ext, type, coordinate, itemparts,
                distributiontemplateid, restrictedapp, allow_app_ids, ids, out_url, is_support_reservation,
                reservation_msg, support_shopping_cart, instructions, virtual_sales, is_distribution, itempropvalues, item_code,onshelftime).compose(TransformUtils.<UpdateGoodBean>defaultSchedulers());

    }

    /**
     * 更新商品------------new
     *
     * @param itemid            商品id
     * @param itemtitle         商品名称
     * @param pictures          展示在轮播
     * @param mobileDetaile     展示在详情
     * @param subtitle          商品描述
     * @param marketprice       市场价
     * @param price             售价
     * @param stock             库存
     * @param customspecnames   自定义属性名
     * @param jsoncustomskus    商品sku
     * @param itemcatid         主营类目
     * @param shopcatids        店铺分类
     * @param onshelftype       1.立即 2.库存 3.定时
     * @param isrecommend       是否是店长推荐
     * @param inventorycount    库存减少方式
     * @param integrallimit     积分限制
     * @param integral_quantity 钱脚忙数量
     */
    public Observable<UpdateGoodBean> updateNewGoods(String itemid, String itemtitle, String pictures, String mobileDetaile, String subtitle,
                                                     String marketprice, String price, String stock, String customspecnames, String jsoncustomskus,
                                                     String onshelftype, String itemcatid, String shopcatids, String isrecommend, String integrallimit,
                                                     String inventorycount, String integral_quantity, String freighttemplateid, String integrakcyrency,
                                                     String ext, String type, String coordinate, String itemparts, String restrictedapp, String allow_app_ids, String ids, String out_url, String is_support_reservation, String reservation_msg,
                                                     String support_shopping_cart, String instructions, String virtual_sales, String is_distribution, String itempropvalues, String stagepayment, String customer_option, String isBuy, String onshelftime) {
        return mSellApi.updatenewGoods(GOOD_UPDATE, itemid, itemtitle, pictures, mobileDetaile, subtitle, marketprice, price, stock, customspecnames,
                jsoncustomskus, itemcatid, shopcatids, isrecommend, onshelftype, integrallimit, inventorycount,
                SellApplication.getInstance().getShopId(), integral_quantity, freighttemplateid, integrakcyrency, ext, type, coordinate, itemparts, restrictedapp,
                allow_app_ids, ids, out_url, is_support_reservation,
                reservation_msg, support_shopping_cart, instructions, virtual_sales, is_distribution, itempropvalues, stagepayment, customer_option, isBuy, onshelftime).compose(TransformUtils.<UpdateGoodBean>defaultSchedulers());

    }


    /**
     * 获取下级类目id
     *
     * @param parentid parentid
     */
    public Observable<UserResponse> getItemCats(String parentid) {
        return mSellApi.getItemCats(URL_GET_ITEMCATS, parentid).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 获取下级类目id
     *
     * @param parentid parentid
     */
    public Observable<ItemsCatsBean> getItemsCats(String parentid) {
        return mSellApi.getItemsCats(URL_GET_ITEMCATS, parentid).compose(TransformUtils.<ItemsCatsBean>defaultSchedulers());
    }

    /**
     * 认证实体店
     *
     * @param address         店铺地址
     * @param hours           营业时间
     * @param title           店铺名称
     * @param businesslicense 营业执照号码
     * @param certifiedphotos 认证照片
     * @param coordinate      坐标
     */
    public Observable<UserResponse> createShop(String address, String hours, String title, String businesslicense, String certifiedphotos, String coordinate) {
        return mAppToH5lApi.createShop(URL_PHYSICAL_SHOP, address, hours, title, businesslicense, certifiedphotos, coordinate, SellApplication.getInstance().getShopId(), "1").compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 更新店铺审核状态
     *
     * @param status 联系电话
     */
    public Observable<UserResponse> upDateAuditStatus(String status) {
        return mSellApi.upDateAuditStatus(URL_UPDATE_AUDITSTATUS, SellApplication.getInstance().getShopId(), status).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 创建网店
     */
    public Observable<UserResponse> createNetShop(String name, String picture, String maincategoryid, String phone, String banner, String virtualcategory) {
        String shopId = SellApplication.getACache().getAsString(Constant.ACacheTag.NETSHOPID);

        return mSellApi.createNetShop(URL_ADD_SHOP, name, picture, maincategoryid, phone, banner, Constant.StopTag.StopType, virtualcategory).compose(TransformUtils.<UserResponse>defaultSchedulers());
//         如果shopid是空的，那么没有创建过店铺
//        if (shopId.equals("0") || TextUtils.isEmpty(shopId)) {
//            return mSellApi.createNetShop(URL_ADD_SHOP, name, picture, maincategoryid, phone, banner, Constant.StopTag.StopType, virtualcategory).compose(TransformUtils.<UserResponse>defaultSchedulers());
//        } else {
//            return mAppToH5lApi.createNetShop(URL_ADD_SHOPS, name, picture, maincategoryid, phone, banner, Constant.StopTag.StopType, virtualcategory).compose(TransformUtils.<UserResponse>defaultSchedulers());
//        }
    }

    /**
     * 更新店铺信息（网店店铺设置）
     *
     * @param picture        店铺logo
     * @param banner         封面
     * @param title          名称
     * @param maincategoryid 主营类目
     * @param phone          电话
     * @param summary        简介
     * @return
     */
    public Observable<UserResponse> upDateNetShopInfo(String picture, String banner, String title, String maincategoryid, String phone, String summary, String allowinvoice) {
        return mSellApi.upDateShopInfo(URL_UPDATE_SHOP, SellApplication.getInstance().getShopId(), picture, banner, title, maincategoryid, phone, summary, allowinvoice, Constant.StopTag.StopType).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

//    /**
//     * 获取店铺信息
//     *
//     * @param shopid 店铺ID
//     */
//    public Observable<UserResponse> turnToGetShopInfo(String shopid) {
//        return mSellApi.turnToGetShopInfo(URL_GET_SHOP_INFO, shopid).compose(TransformUtils.<UserResponse>defaultSchedulers());
//    }

    /**
     * 获取店铺信息
     */
    public Observable<ShopInfoBeans> turnToGetShop() {
        return mSellApi.turnToGetShop(URL_GET_SHOP_INFO, SellApplication.getInstance().getShopId()).compose(TransformUtils.<ShopInfoBeans>defaultSchedulers());
    }

    /**
     * 获取店铺信息
     */
//    public Observable<ShopConfirmBean> turnToGetShop1() {
//        return mSellApi.turnToGetShop1(URL_GET_SHOP_INFO, SellApplication.getInstance().getShopId()).compose(TransformUtils.<ShopConfirmBean>defaultSchedulers());
//    }

    /**
     * 获取店铺信息
     */
    public Observable<ShopConfirmBean> turnToGetMyShopifno(String shopid) {
        return mSellApi.turnToGetShop1(URL_GET_SHOP_INFO, shopid).compose(TransformUtils.<ShopConfirmBean>defaultSchedulers());
    }

    /**
     * 获取店铺首页
     */
    public Observable<ShopFirstBean> turnToGetShopFirst() {
        return mSellApi.turnToGetShopFirst("yun.shop.datastatistics.summary.get", SellApplication.getInstance().getShopId()).compose(TransformUtils.<ShopFirstBean>defaultSchedulers());
    }

    /**
     * 获取城市列表（地区选择）
     *
     * @param parentid 父id
     */
    public Observable<AreaResponseBean> getCityList(String parentid) {
        return mSellApi.getCityList(URL_GET_CITY_LIST, "1", "100", "", "", "", parentid).compose(TransformUtils.<AreaResponseBean>defaultSchedulers());
    }

    /**
     * 获取店铺数据
     *
     */
    public Observable<SummaryDataBean> getSummaryData(String shopid) {
        return mSellApi.getSummaryData(URL_SHOP_SUMMARY_GET, shopid).compose(TransformUtils.<SummaryDataBean>defaultSchedulers());
    }

    /**
     * 获取功能分类 图片信息
     */
    public Observable<StoreFunctionMenuInfoBean> getMenuInfo() {
        return mSellApi.getMenuInfo(URL_GET_MENU_INFO, "true", "false", "2").compose(TransformUtils.<StoreFunctionMenuInfoBean>defaultSchedulers());
    }

    /**
     * 获取BANNER
     */
    public Observable<StoreBannerBean> getBanner() {
        return mSellApi.getBanner(URL_GET_BANNER, "7", "80b36d6be3bb4b10b541c3cd21b0d9c5").compose(TransformUtils.<StoreBannerBean>defaultSchedulers());
    }

    /**
     * 获取自定义商品列表
     *
     * @param parentid 商品id
     */
    public Observable<AddGoodsCategoryBean> getShopGoodsCategory(String parentid) {
        return mSellApi.getShopGoodsCategory(URL_GOODSCATEGORYLIST, parentid, SellApplication.getInstance().getShopId()).compose(TransformUtils.<AddGoodsCategoryBean>defaultSchedulers());
    }

    /**
     * 修改商铺自定义商品(更新)
     *
     * @param id      商品id
     * @param title   商品名称
     * @param display 是否显示
     * @param sort    排序
     */
    public Observable<UserResponse> updateShopGoods(String id, String title, String display, String sort) {
        return mSellApi.updateShopGoods(URL_UPDATASHOPITEM, id, title, display, sort).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 删除商铺自定义商品
     *
     * @param id 商品id
     */
    public Observable<UserResponse> deleteShopGoods(String id) {
        return mSellApi.updateShopGoods(URL_DELETESHOPITEM, id, "", "", "").compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 获取订单信息
     *
     * @param pagenum       当前页
     * @param pagesize      请求条数
     * @param tradestatus   订单状态
     * @param mincreatetime 最早下单时间
     * @param isdelete      是否已删除
     * @return
     */
    public Observable<TradesInfoBean> getSoldTradesInfo(String pagenum, String pagesize, String tradestatus, String mincreatetime, String isdelete, String goodstype, String orderId, String mobile, String itemtitle) {
        String dateToString = DateUtil.getDateToString(Long.parseLong(TextUtils.isEmpty(mincreatetime) ? "0" : mincreatetime) * 1000);
        return mSellApi.getSoldTradesInfo(TRADES_GETINFO, pagenum, pagesize, tradestatus, dateToString, isdelete, SellApplication.getInstance().getShopId(), orderId, itemtitle, mobile, goodstype).compose(TransformUtils.<TradesInfoBean>defaultSchedulers());
    }

    /**
     * 获取订单信息
     *
     * @param pagenum       当前页
     * @param pagesize      请求条数
     * @param tradestatus   订单状态
     * @param mincreatetime 最早下单时间
     * @param isdelete      是否已删除
     * @return
     */
    public Observable<TradesInfoBean> getSoldTradesInfo(String pagenum, String pagesize, String tradestatus, String mincreatetime, String isdelete, String goodstype, String orderId, String mobile, String itemtitle, String activityId) {
        String dateToString = DateUtil.getDateToString(Long.parseLong(TextUtils.isEmpty(mincreatetime) ? "0" : mincreatetime) * 1000);
        return mSellApi.getSoldTradesInfo(TRADES_GETINFO, pagenum, pagesize, tradestatus, dateToString, isdelete, SellApplication.getInstance().getShopId(), orderId, itemtitle, mobile, goodstype, activityId).compose(TransformUtils.<TradesInfoBean>defaultSchedulers());
    }

    /**
     * 添加商铺自定义商品(更新)
     *
     * @param parentid 父id
     * @param title    商品名称
     * @param display  是否显示
     * @param sort     排序
     */
    public Observable<UserResponse> addShopGoodsCategory(String parentid, String title, String display, String sort) {
        return mSellApi.addShopGoodsCategory(URL_ADDSHOPGOODSCATEGORY, parentid, title, display, sort, SellApplication.getInstance().getShopId()).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

//    /**
//     * 获取订单信息 通过订单号查询
//     *
//     * @param pagenum  当前页
//     * @param pagesize 请求条数
//     * @param orderid  订单id
//     * @return
//     */
//    public Observable<TradesInfoBean> getSoldTradesInfoById(String pagenum, String pagesize, String orderid, String isdelete,String status) {
//        return mSellApi.getSoldTradesInfo(TRADES_GETINFO, pagenum, pagesize, status, "", isdelete, SellApplication.getACache().getAsString(Constant.ACacheTag.NETSHOPID), orderid, "", "").compose(TransformUtils.<TradesInfoBean>defaultSchedulers());
//    }

//    /**
//     * 获取取消订单的数量
//     *
//     * @param pagenum  当前页
//     * @param pagesize 请求条数
//     * @param status   订单状态
//     * @return
//     */
//    public Observable<TradesInfoBean> getCancelOrderCount(String pagenum, String pagesize, String status, String isdelete) {
//        return mSellApi.getSoldTradesInfo(TRADES_GETINFO, pagenum, pagesize, status, "", isdelete, "", "", "", "").compose(TransformUtils.<TradesInfoBean>defaultSchedulers());
//    }


    /**
     * 获取运费模板
     */
    public Observable<FreightTempBean> getFreightTemps() {
        return mSellApi.getFreightTemps(URL_GET_FREIGHTTEMPLATES, SellApplication.getInstance().getShopId()).compose(TransformUtils.<FreightTempBean>defaultSchedulers());
    }

//    /**
//     * 获取订单信息 通过名称查询
//     *
//     * @param pagenum   当前页
//     * @param pagesize  请求条数
//     * @param itemtitle 名称
//     */
//    public Observable<TradesInfoBean> getSoldTradesInfoByName(String pagenum, String pagesize, String itemtitle, String isdelete) {
//        return mSellApi.getSoldTradesInfo(TRADES_GETINFO, pagenum, pagesize, "", "", isdelete, "", "", itemtitle, "").compose(TransformUtils.<TradesInfoBean>defaultSchedulers());
//    }
//
//    /**
//     * 获取订单信息 通过手机号查询
//     *
//     * @param pagenum  当前页
//     * @param pagesize 请求条数
//     * @param mobile   名称
//     */
//    public Observable<TradesInfoBean> getSoldTradesInfoByMobeil(String pagenum, String pagesize, String mobile, String isdelete,String states) {
//        return mSellApi.getSoldTradesInfo(TRADES_GETINFO, pagenum, pagesize, states, "", isdelete, "", "", "", mobile).compose(TransformUtils.<TradesInfoBean>defaultSchedulers());
//    }

    /**
     * 发货
     *
     * @param orderid        订单id
     * @param expressname    快递公司名称
     * @param trackingnumber 物流单号
     * @return
     */
    public Observable<OrderDeliverResultBean> delivery(String orderid, String expressname, String trackingnumber) {
        return mSellApi.delivery(TRADES_DELIVERY, orderid, expressname, trackingnumber).compose(TransformUtils.<OrderDeliverResultBean>defaultSchedulers());
    }

    /**
     * 获取常用快递公司
     *
     * @return
     */
    public Observable<ExpressBean> getExpress() {
        return mSellApi.getExpress(EXPRESS_GET).compose(TransformUtils.<ExpressBean>defaultSchedulers());
    }

    /**
     * 订单详情
     *
     * @param id 订单id
     * @return
     */
    public Observable<OrderDetailsBean> getOrderDetails(String id) {
        return mSellApi.getOrderDetails(TRADES_DETAILS_GET, id).compose(TransformUtils.<OrderDetailsBean>defaultSchedulers());
    }

    /**
     * 获得退款信息列表
     *
     * @param pagenum  页码
     * @param pagesize 页容量
     * @param status   状态
     * @return
     */
    public Observable<GoodsRefundBean> getGoodsReturnInfo(String pagenum, String pagesize, String status) {
        return mSellApi.getGoodsReturnInfo(GOOD_SELLERREFUNDS, pagenum, pagesize, status, SellApplication.getInstance().getShopId()).compose(TransformUtils.<GoodsRefundBean>defaultSchedulers());
    }

    /**
     * 添加运费模板
     *
     * @param title            模板名称
     * @param farefree         免邮数量
     * @param logisticsprice   运费价格
     * @param pricetype        计费方式
     * @param farefreestrategy 促销战略
     */
    public Observable<UserResponse> addFreightTemp(String title, String farefree, String logisticsprice,
                                                   String farefreestrategy, String pricetype) {
        return mSellApi.addFreightTemp(URL_ADD_FREIGHTTEMP, farefree, title, logisticsprice, pricetype, farefreestrategy, SellApplication.getInstance().getShopId()).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 添加系统默认运费模板
     *
     * @param title     模板名称
     * @param farefree  免邮数量
     * @param isdefault 默认是否
     */
    public Observable<UserResponse> addSysDefaultTemp(String title, String farefree, String isdefault) {
        return mSellApi.addSysDefaultTemp(URL_ADD_FREIGHTTEMP, farefree, title, isdefault, SellApplication.getInstance().getShopId()).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }


    /**
     * 修改订单状态
     *
     * @param orderrefundid 退款单编号
     * @param status        状态
     * @param remark        备注
     * @return
     */
    public Observable<GoodsRefundResultBean> changeRefundState(String orderrefundid, String status, String remark) {
        return mSellApi.changeRefundState(GOOD_CHANGE_REFUND_STATE, orderrefundid, status, remark, SellApplication.getInstance().getShopId()).compose(TransformUtils.<GoodsRefundResultBean>defaultSchedulers());
    }


    /**
     * 删除订单
     *
     * @param tradeid 交易单号
     * @return
     */
    public Observable<GoodsRefundResultBean> deleteOrder(String tradeid) {

        return mSellApi.deleteOrder(REFUNDID_DELETE, tradeid).compose(TransformUtils.<GoodsRefundResultBean>defaultSchedulers());
    }


    /**
     * 获取常用快递公司列表
     *
     * @return
     */
    public Observable<GoodsPromotionBean> getGoodsPromotion(String itemid) {
        return mSellApi.getGoodsPromotion(URL_GET_PROMOTION, itemid).compose(TransformUtils.<GoodsPromotionBean>defaultSchedulers());
    }
    /**
     * 获取常用快递公司列表
     *
     * @return
     */
    public Observable<CompaniesBean> getCommonExpress() {
        return mSellApi.getAllExpress(CommonEXPRESS_GET, SellApplication.getInstance().getShopId()).compose(TransformUtils.<CompaniesBean>defaultSchedulers());
    }

    /**
     * 获取常用快递公司列表
     *
     * @return
     */
    public Observable<CompaniesBean> getAllExpress() {
        return mSellApi.getAllExpress(URL_GET_ALL_EXPRESS, SellApplication.getInstance().getShopId()).compose(TransformUtils.<CompaniesBean>defaultSchedulers());
    }

    /**
     * 获取常用快递公司列表
     *
     * @return
     */
    public Observable<SellerOrdersBean> getSellerOrders() {
        return mSellApi.getSellerOrder(URL_GET_SELLER_ORDER,SellApplication.getInstance().getShopId()).compose(TransformUtils.<SellerOrdersBean>defaultSchedulers());
    }
    /**
     * 获取常用快递公司列表
     *
     * @return
     */
    public Observable<SalesOrderBean> getAllOrder() {
        return mSellApi.getAllorder(URL_GET_ALL_ORDER,SellApplication.getInstance().getShopId(),"true","1","2","false","0").compose(TransformUtils.<SalesOrderBean>defaultSchedulers());
    }

    /**
     * 保存常用快递
     *
     * @return
     */
    public Observable<UserResponse> getAddExpress(String name, String type) {
        return mSellApi.getAddExpress(ADDEXPRESS_GET, name, type, SellApplication.getInstance().getShopId()).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 删除常用快递
     *
     * @return
     */
    public Observable<UserResponse> getDeleteExpress(String id) {
        return mSellApi.getDeleteExpress(DeleteEXPRESS_GET, id, SellApplication.getInstance().getShopId()).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * @param id 模板id
     */
    public Observable<UserResponse> deleteTemp(String id) {
        return mSellApi.deleteTemp(URL_DELETE_FREIGHTTEMP, id).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 修改运费模板
     *
     * @param id               模板id
     * @param title            模板名称
     * @param farefree         免邮数量
     * @param logisticsprice   运费价格
     * @param pricetype        计费方式
     * @param is_default       默认
     * @param farefreestrategy 促销战略
     */
    public Observable<UserResponse> modofyFreightTemp(String id, String title, String farefree, String logisticsprice,
                                                      String farefreestrategy, String is_default, String pricetype) {
        return mSellApi.modifyFreightTemp(URL_UPDATE_FREIGHTTEMP, farefree, title, logisticsprice, pricetype, farefreestrategy, is_default, id).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 获取店铺财务数据
     */
    public Observable<ShopFinancialBean> getShopFinancial() {
        return mSellApi.getShopFinancial(URL_GETSHOPFINANCIAL, SellApplication.getInstance().getShopId()).compose(TransformUtils.<ShopFinancialBean>defaultSchedulers());
    }

    /**
     * 获取提现列表
     *
     * @param pagenum  页码
     * @param pagesize 每页的展示条目的数量
     */
    public Observable<TakeMoneyBean> getRecordList(String pagenum, String pagesize) {
        return mSellApi.getRecordList(URL_GETRECORDLIST, pagenum, pagesize, SellApplication.getACache().getAsString(Constant.ACacheTag.PAYACCOUNTID)).compose(TransformUtils.<TakeMoneyBean>defaultSchedulers());
    }

    /**
     * 提现
     *
     * @param money       提现金额
     * @param realname    真实名字
     * @param accountname 账号名字
     * @param banknum     账号
     * @param phone       手机号
     */
    public Observable<UserResponse> takeMoney(String money, String realname, String banknum, String accountname, String bankname, String phone, String bankcardid) {
        return mSellApi.getTakemoney(URL_GETTAKEMONEY, money, realname, banknum, accountname, phone, bankname, bankcardid, DateUtil.getCurrentTime() / 1000 + SellApplication.getACache().getAsString(Constant.ACacheTag.USER_ID)).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    public Observable<UserResponse> turntoBindBankcard(String realname, String bankname, String banknum, String phone, String id, String iscard) {
        return mSellApi.turnToBindBankcard(URL_BINDBANKCARD, realname, bankname, banknum, phone, id, "", "").compose(TransformUtils.<UserResponse>defaultSchedulers());
    }


    public Observable<AppToH5Bean> getClaimUrl(String userid, String session, String statue) {
        return mAppToH5lApi.getClaimUrl(userid, session, statue).compose(TransformUtils.<AppToH5Bean>defaultSchedulers());
    }

    /**
     * 运费模板默认按钮
     *
     * @param id        模板id
     * @param isdefault 是否默认
     */
    public Observable<UserResponse> defaultState(String id, String isdefault) {
        return mSellApi.defaultState(URL_DEFAULTSTATE, id, isdefault).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 意见反馈
     *
     * @param content 反馈内容
     * @param ext     联系方式
     */
    public Observable<UserResponse> feedback(String content, String ext) {
        return mSellApi.feedback(FEEDBACK, content, ext).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    public Observable<UserResponse> updateVersion() {
        return mSellApi.updateVersion(UPDATE_VERSION, 1, 1).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    public Observable<UserResponse> getIDCARD(String id) {
        return mSellApi.getIDCARD(URL_GET_IDCARD, id).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    public Observable<BankListBean> getBanklist() {
        return mAppToH5lApi.getBanklist("").compose(TransformUtils.<BankListBean>defaultSchedulers());
    }

    //获取关于信息
    public Observable<AboutInfo> getAboutInfo() {
        return mSellApi.getAboutInfo(CONTACT_GET).compose(TransformUtils.<AboutInfo>defaultSchedulers());
    }

    /**
     * 身份认证
     *
     * @return
     */
    public Observable<UserResponse> getAutoIDcard(String name, String idcard, String positiveidentitycard, String backofidcard, String idcardhandheld) {
        return mSellApi.getAutoIDcard(URL_GET_AUTOIDCARD, name, idcard, positiveidentitycard, backofidcard, idcardhandheld).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 身份认证
     *
     * @return
     */
    public Observable<UserResponse> turnToApplyforIdentity(String name, String idcard, String imgs) {
        return mSellApi.turnApplyIdentity(URL_APPLY_FOR_IDENTITY, SellApplication.getACache().getAsString(Constant.ACacheTag.USER_SELLER_ID), name, imgs, idcard, "", "0").compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 阿里云token
     *
     * @param token
     * @return
     */
    public Observable<UserResponse> setToken(String token) {
        return mSellApi.setToken(GET_PASH_TOKEN, DeviceInfoUtils.getDeviceId(), "[{\"name\":\"aliyun\",\"token\":\"" + token + "\"}]").compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 退出
     *
     * @return
     */
    public Observable<UserResponse> getExit() {
        return mSellApi.getExit(USER_EXIT).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 优惠券列表
     */
    public Observable<CouponListBean> getCouponList(String pagenum, String pagesize, String shopid, String validityperiod, String receivestatus) {
        return mSellApi.getCouponList(URL_GETCOUPONLIST, pagenum, pagesize, shopid, validityperiod, receivestatus).compose(TransformUtils.<CouponListBean>defaultSchedulers());
    }

    /**
     * 添加商铺
     */
    public Observable<PackResponse> addShop(String address, String province, String area, String city, String town, String coordinate, String maincategoryId, String name, String phone, String virtualcategory) {
        return mMySellApi.addShop(URL_ADDSHOP, address, province, area, city, town, coordinate, maincategoryId, name, phone, virtualcategory).compose(TransformUtils.<PackResponse>defaultSchedulers());
    }


    public Observable<GetImTokenBean> getImToken() {
        return mAppToH5lApi.getImToken(GETIMTOKEN).compose(TransformUtils.<GetImTokenBean>defaultSchedulers());
    }

    /**
     * 新增优惠券
     */
    public Observable<UserResponse> addCoupon(String name, String credit, String begintime, String endtime, String range, String itemsid, String minprice, String coupontype, String num, String displayposition, String status) {
        return mSellApi.addCoupon(URL_COUPONADD, name, credit, begintime, endtime, range, itemsid, minprice, coupontype, num, displayposition, status, SellApplication.getInstance().getShopId()).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }


    /**
     * 优惠券选择商品
     */
    public Observable<UserResponse> choosegoods(String categoryid) {
        return mSellApi.choosegoods(URL_COUPONGET, categoryid).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 根据用户id或者店铺名称   搜索商铺
     */
    public Observable<ShopListBean> searchShop(String pagenum, String pagesize, String shopname, String createid, String bounduserid, String s, String shoptype) {
        return mSellApi.searchShop(URL_SEARH_SHOP, pagenum, pagesize, shopname, createid, "", "",
                "", "", "", "", "", "", "", ""
                , "", "", bounduserid, s, shoptype).compose(TransformUtils.<ShopListBean>defaultSchedulers());
    }

    /**
     * 根据地址 搜索商铺
     */
    public Observable<ShopListBean> searchShop(String pagenum, String pagesize
            , String province, String city, String area) {
        return mSellApi.searchShop(URL_SEARH_SHOP, pagenum, pagesize, province, city, area, "0", "", "2").compose(TransformUtils.<ShopListBean>defaultSchedulers());
    }

    /**
     * 根据地址 搜索商铺
     */
    public Observable<ShopListBean> searchNewShopList(String pagenum, String pagesize
    ) {
        return mSellApi.searchShop(URL_SEARCH_NEW_SHOP_LIST, pagenum, pagesize).compose(TransformUtils.<ShopListBean>defaultSchedulers());
    }

    /**
     * 根据companyid 搜索商铺
     */
    public Observable<ShopListBean> searchShop(String pagenum, String pagesize, String companyid, String sort) {
        return mSellApi.searchShop(URL_SEARH_SHOP, pagenum, pagesize, companyid, sort).compose(TransformUtils.<ShopListBean>defaultSchedulers());
    }

    /**
     * 获取实体店列表  type==2
     */
    public Observable<ShopListBean> searchShops(String pagenum, String pagesize, String name) {
        return mSellApi.searchBindShop(URL_SEARH_SHOP, pagenum, pagesize, "2", name).compose(TransformUtils.<ShopListBean>defaultSchedulers());
    }

    /**
     * 删除店铺
     */
//    public Observable<ShopListBean> deleteShop(String pagenum, String pagesize, String shopname, String categoryid, String areaid,
//                                               String companyid, String fields, String mincreatetime, String maxcreatetime
//            , String isenabled, String isopen, String certificationstatus, String shopids,
//                                               String sort, String parentid, String itemcatid, String bounduserid) {
//        return mSellApi.searchShop(URL_SEARH_SHOP, pagenum, pagesize, shopname, categoryid, areaid, companyid,
//                fields, mincreatetime, maxcreatetime, isenabled, isopen, certificationstatus, shopids, sort
//                , parentid, itemcatid, bounduserid).compose(TransformUtils.<ShopListBean>defaultSchedulers());
//    }

    /**
     * 获取店铺信息
     */
    public Observable<ShopConfirmBean> turnToGetShopInfo(String id) {
        return mSellApi.turnToGetShop1(URL_GET_SHOP_INFO, id).compose(TransformUtils.<ShopConfirmBean>defaultSchedulers());
    }

    /**
     * 删除店铺
     */
    public Observable<PackResponse> turnToDeleteShop(String id) {
        return mSellApi.deleteShop(URL_DELETE_SHOP, id).compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    /**
     * 认领店铺
     */
    public Observable<PackResponse> turnToClaimShop(String id) {
        return mSellApi.claimShop(URL_CLAIM_SHOP, id).compose(TransformUtils.<PackResponse>defaultSchedulers());
    }


    /**
     * 更新店铺信息（网店店铺设置）
     *
     * @param title          名称
     * @param maincategoryid 主营类目
     * @param phone          电话
     * @return
     */
    public Observable<UserResponse> turntoUpdateShopinfo(String shopid, String title, String maincategoryid, String phone, String address, String type, String location,
                                                         String virtualcategory) {
        return mSellApi.updateShopinfo(URL_UPDATE_SHOPINFO, shopid, title, maincategoryid, phone, address, type, location, virtualcategory).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    public Observable<UserResponse> updateShopaddress(String shopid, String province, String city, String area, String town, String coordinate, String type) {
        return mSellApi.updateShopaddress(URL_UPDATE_SHOPINFO, shopid, province, city, area, town, coordinate, type).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }
    /**
     * 更新店铺信息（网店店铺设置）
     *
     * @param title          名称
     * @param maincategoryid 主营类目
     * @param phone          电话
     * @return
     */
//    public Observable<UserResponse> turntoUpdateShopAddress(String shopid, String title, String maincategoryid, String phone, String address, String type, String location) {
//        return mSellApi.updateShopinfo(URL_UPDATE_SHOPINFO, shopid, title, maincategoryid, phone, address, type, location).compose(TransformUtils.<UserResponse>defaultSchedulers());
//    }

    /**
     * 获得限时购列表
     *
     * @param pagenum  页码
     * @param pagesize 也容量
     * @param status   状态（进行中，未开始，已结束）
     * @param shopid   店铺id
     * @return
     */
    public Observable<TimeLimitListBean> getTimeLimitList(String pagenum, String pagesize, String status, String shopid) {
        return mSellApi.getTimeLimitList(GETTIMELIMITLIST, pagenum, pagesize, status, shopid).compose(TransformUtils.<TimeLimitListBean>defaultSchedulers());
    }

    /**
     * 新增限时购
     *
     * @param name      限时购名称
     * @param starttime 开始时间
     * @param endtime   结束时间
     * @param ext       商品列表
     * @param shopid    店铺id
     * @return
     */
    public Observable<GoodsAddBean> addTimeLimit(String name, String starttime,
                                                 String endtime, String ext, String shopid) {
        return mSellApi.addTimeLimit(TIMELIMITADD, name, starttime, endtime, ext, shopid).compose(TransformUtils.<GoodsAddBean>defaultSchedulers());
    }

    /**
     * 修改限时购
     *
     * @param name       限时购名称
     * @param starttime  开始时间
     * @param endtime    结束时间
     * @param activityid 限时购id
     * @return
     */
    public Observable<GoodsAddBean> editTimeLimit(String name, String starttime,
                                                  String endtime, String activityid, String ext) {
        return mSellApi.editTimeLimit(TIMELIMITEDIT, name, starttime, endtime, activityid, ext).compose(TransformUtils.<GoodsAddBean>defaultSchedulers());
    }


    public Observable<BooleanResultBean> addLimitGoods(String activityid, String itemscontent, String remove_original_record) {
        return mSellApi.addLimitGoods(URL_ADD_GOODS, activityid, itemscontent, remove_original_record).compose(TransformUtils.<BooleanResultBean>defaultSchedulers());
    }

//    /**
//     * 获取限时购价格标签列表
//     */
//    public Observable<ElementBean> getPriceElementList(String pagenum, String pagesize, String placename) {
//        return mAppToH5lApi.getPriceElementList(GETPRICEELEMENT, pagenum, pagesize, placename).compose(TransformUtils.<ElementBean>defaultSchedulers());
//    }

    /**
     * 获取元素列表
     */
    public Observable<ElementBean> getElementList(String cat) {
        return mSellApi.getElementList(URL_CUSTOMTYPE_GET, cat).compose(TransformUtils.<ElementBean>defaultSchedulers());
    }


    /**
     * 优惠券详情
     */
    public Observable<CouponDetailBean> getCouponDetail(String categoryid) {
        return mSellApi.getCouponDetail(URL_COUPONGET, categoryid).compose(TransformUtils.<CouponDetailBean>defaultSchedulers());
    }

    /**
     * 优惠券详情——列表
     */
    public Observable<CouponUseBean> getCouponDetailList(String pagenum, String pagesize, String shopid, String categoryid, String tradeid) {
        return mSellApi.getCouponDetailList(URL_COUPONFIND, pagenum, pagesize, categoryid, tradeid).compose(TransformUtils.<CouponUseBean>defaultSchedulers());
    }

    /**
     * 获得限时购详情
     *
     * @param activityid 活动id
     * @return
     */
    public Observable<TimeLimitDetailBean> getTimeLimitDetail(String activityid) {
        return mSellApi.getTimeLimitDetail(GETTIMELIMITDETAL, activityid).compose(TransformUtils.<TimeLimitDetailBean>defaultSchedulers());
    }

    /**
     * 获取绑定银行卡列表
     *
     * @param pagenum
     * @param pagesize
     * @return
     */
    public Observable<BankCardListBean> getBankCardList(String pagenum, String pagesize) {
        return mSellApi.getBankCardList(URL_GETBANKCARDLIST, pagenum, pagesize, SellApplication.getACache().getAsString(Constant.ACacheTag.PAYACCOUNTID)).compose(TransformUtils.<BankCardListBean>defaultSchedulers());
    }

    /**
     * 结束限时购
     *
     * @param activityid
     * @return
     */
    public Observable<GoodsAddBean> stopTimeLimit(String activityid, String endtime) {
        return mSellApi.stopTimeLimit(STOPTIMELIMIT, activityid, endtime).compose(TransformUtils.<GoodsAddBean>defaultSchedulers());
    }


    /**
     * 编辑优惠券
     */
    public Observable<UserResponse> editCoupon(String name, String credit, String range, String itemsid, String statue, String categoryid, String displayPosition) {
        return mSellApi.editCoupon(URL_COUPONEDIT, name, credit, range, itemsid, statue, categoryid, displayPosition).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 获取评价列表
     */
    public Observable<GetEvaluatesBean> turntoGetEvaluates(String pagenum, String pagesize, String itemid, String shopid, String userid, String starrating, String hasbuyercontent, String sellerhascomment, String hasimages) {
        return mSellApi.getEvaluates(URL_GET_EVALUATES, pagenum, pagesize, itemid, shopid, userid, starrating, hasbuyercontent, sellerhascomment, hasimages).compose(TransformUtils.<GetEvaluatesBean>defaultSchedulers());
    }

    /**
     * 回复买家的评价
     */
    public Observable<PackResponse> turntoReplyEvaluate(String id, String result, String content) {
        return mSellApi.replyEvaluate(URL_REPLY_EVALUATE, id, result, content).compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    /**
     * 新增评价
     */
    public Observable<GetEvaluatesBean> turntoAddEval(String id, String result, String content, String json, String imgs) {
        return mSellApi.turntoAddEval("yun.buyer.traderate.add", id, result, content, json, imgs).compose(TransformUtils.<GetEvaluatesBean>defaultSchedulers());
    }

    public Observable<UserResponse> turntoChangeShop(String shopid) {
        return mSellApi.turntoChangeShop(URL_CHANGE_SHOP, shopid).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }


    /**
     * 搜索主营类目(已去除主营类目功能)
     */
    public Observable<SearchMainItemCateBean> searchMainItemCate(String pagenum, String pagesize, String name) {
        return mAppToH5lApi.searchMainItem(GOOD_MAINITEM_SEARCH, pagenum, pagesize, name).compose(TransformUtils.<SearchMainItemCateBean>defaultSchedulers());
    }

    /**
     * 获得退款订单的列表
     */
    public Observable<OrderRefundListBean> getApplyRefundList(String pagenum, String pagesize, String mincreatetime) {
        return sellApi1310.getApplyRefundList(APPLYREFUNDLIST, pagenum, pagesize, SellApplication.getACache().getAsString(Constant.ACacheTag.NETSHOPID), mincreatetime).compose(TransformUtils.<OrderRefundListBean>defaultSchedulers());
    }

    /**
     * 每日专题活动
     * <p>
     * 获取专题列表接口
     */

    public Observable<SubjectDataBean> getSubjectList(String pagenum, String pagesize) {
        return mSellApi.turntoGetSubjectlist(SUBJECT_LIST, pagenum, pagesize).compose(TransformUtils.<SubjectDataBean>defaultSchedulers());
    }

    /**
     * <p>
     * 获取支付id
     */

    public Observable<NumberReponseBean> getPayAccountId(String associatedaccountid, String contenttype) {
        return mSellApi.getPayAccountId(URL_GETPAYACCOUNTID, associatedaccountid, contenttype).compose(TransformUtils.<NumberReponseBean>defaultSchedulers());
    }


    /**
     * <p>
     * 解绑银行卡
     */

    public Observable<NumberReponseBean> unBindBankCard(String bankcardid, String payaccountid) {
        return mSellApi.unBindBankCard(URL_UNBINDBANKCARD, bankcardid, payaccountid).compose(TransformUtils.<NumberReponseBean>defaultSchedulers());
    }

    /**
     * <p>
     * 设置默认银行卡
     */

    public Observable<UserResponse> setDefaultCard(String bankcardid, String isdefault) {
        return mSellApi.setDefaultCard(URL_SETDEFAULTCARD, bankcardid, isdefault).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }


    /**
     * <p>
     * 检测银行卡有效性
     */

    public Observable<UserResponse> checkTheCardInfo(String acctname,
                                                     String acctpan,
                                                     String certid,
                                                     String phonenum) {
        return mSellApi.checkTheCardInfo(URL_CHECKTHECARDINFO, acctname, acctpan, certid, phonenum).compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * <p>
     * 获取银行卡信息
     */

    public Observable<BankCardInfoBean> getCardInfo(String bankno) {
        return mSellApi.getCardInfo(URL_GETCARDINFO, bankno).compose(TransformUtils.<BankCardInfoBean>defaultSchedulers());
    }

    /**
     * <p>
     * 获取退货地址库
     */

    public Observable<MyAddressBean> getAddresslist(String sort, String addresstype) {
        return mSellApi.getAddresslist(ADDRESS_LIST, sort, addresstype, SellApplication.getACache().getAsString(Constant.ACacheTag.USER_SELLER_ID)).compose(TransformUtils.<MyAddressBean>defaultSchedulers());
    }

    /**
     * 保存地址
     *
     * @param id
     * @param recipient
     * @param contactPhone
     * @param p
     * @param c
     * @param a
     * @param addressInDetail
     * @param isdefault
     * @param id1
     * @param id2
     * @param id3
     * @param id4
     * @param town
     * @return
     */
    public Observable<PackResponse> turnToSaveAddress(String id, final String recipient, String contactPhone, String p, String c, String a, String addressInDetail, String isdefault, String id1, String id2, String id3, String id4, String town, String type) {

        return mSellApi
                .turnToSaveAddress(URL_SAVE_ADDRESS, id, p, c, a, addressInDetail, "", recipient, contactPhone, isdefault,
                        addressInDetail, id1, id2, id3, id4, town, type, SellApplication.getACache().getAsString(Constant.ACacheTag.USER_SELLER_ID))
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    /**
     * <p>
     * 获取退货地址库
     */

    public Observable<AddressDetailBean> getAddressDetail(String id) {
        return mSellApi.getAddressDetail(URL_GET_DETAIL_ADDRESS, id).compose(TransformUtils.<AddressDetailBean>defaultSchedulers());
    }

    public Observable<PackResponse> turnToDeleteAddress(String id) {

        return mSellApi.turnToDeleteAddress(URL_DELETE_ADDRESS, id)
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    /**
     * <p>
     * 获取退款单列表
     */

    public Observable<SellerRefundsListBean> getSellerRefundsList(String pagenum, String pagesize, String refundtype, String status, String receiverMobile, String tradeId, String refundId) {
        return mSellApi.getSellerRefundsList(SELLERREFUNDS, pagenum, pagesize, refundtype, status, receiverMobile, tradeId, refundId, SellApplication.getACache().getAsString(Constant.ACacheTag.NETSHOPID)).compose(TransformUtils.<SellerRefundsListBean>defaultSchedulers());
    }

    /**
     * <p>
     * 增加退款单关联的浏览（协调）
     */

    public Observable<SellerRefundsListBean> addRefundmark(String orderrefundid, String images, String remark) {
        return mSellApi.addRefundMarks(REFUNDREMARKADD, orderrefundid, images, remark).compose(TransformUtils.<SellerRefundsListBean>defaultSchedulers());
    }


    /**
     * <p>
     * 获取退款详情
     */

    public Observable<RefundDetailsBean> getRefundDetails(String refundid) {
        return mSellApi.getRefundDetails(GETREFUNDDETAIL, refundid).compose(TransformUtils.<RefundDetailsBean>defaultSchedulers());
    }


    /**
     * <p>
     * 拒绝退款
     */

    public Observable<NumberReponseBean> refundStatusChange(String orderrefundid, String remark, String status, String images) {
        return mSellApi.refundStatusChange(REFUNDDISAGREE, orderrefundid, remark, status, images).compose(TransformUtils.<NumberReponseBean>defaultSchedulers());
    }

//    /**
//     * <p>
//     * 只退款  拒绝/同意
//     */
//
//    public Observable<NumberReponseBean> refundChange(String orderrefundid,String remark,String status,String images) {
//        return mSellApi.refundDisagree(REFUNDDISAGREE, orderrefundid,remark,status,images).compose(TransformUtils.<NumberReponseBean>defaultSchedulers());
//    }

    /**
     * <p>
     * 同意
     */

    public Observable<NumberReponseBean> refundAgree(String orderrefundid, String remark, String addressid, String images) {
        return mSellApi.refundAgree(REFUNDAGREE, orderrefundid, remark, addressid, images).compose(TransformUtils.<NumberReponseBean>defaultSchedulers());
    }

    /**
     * <p>
     * 协调
     */

    public Observable<NumberReponseBean> refundAddRemark(String orderrefundid, String remark, String images) {
        return mSellApi.refundAddRemark(REFUNDREMARKADD, orderrefundid, remark, images).compose(TransformUtils.<NumberReponseBean>defaultSchedulers());
    }

    /**
     * <p>
     * 平台介入
     */
    public Observable<NumberReponseBean> systemIn(String orderrefundid, String remark, String images) {
        return mSellApi.systemIn(SYSTEMIN, orderrefundid, remark, images).compose(TransformUtils.<NumberReponseBean>defaultSchedulers());
    }

    /**
     * <p>
     * 获取仅退款和退货退款的条目数量
     */
    public Observable<RefundCountBean> getRefundCount() {
        return mSellApi.getRefundCount(REFUNDCOUNT, SellApplication.getACache().getAsString(Constant.ACacheTag.NETSHOPID)).compose(TransformUtils.<RefundCountBean>defaultSchedulers());
    }

    /**
     * <p>
     * 获取仅退款和退货退款的条目数量
     */
    public Observable<MoneyTypeBean> getMoneyType(String pagenum, String pagesize) {
        return mSellApi.getMoneyType(GETMONEYTYPE, pagenum, pagesize).compose(TransformUtils.<MoneyTypeBean>defaultSchedulers());
    }

    /**
     * <p>
     * 添加主营类目
     */
    public Observable<NumberReponseBean> addGoodsItem(String parentid, String name) {
        return mSellApi.addGoodsItem(GOODSITEMCATEADD, parentid, name, "1").compose(TransformUtils.<NumberReponseBean>defaultSchedulers());
    }


    /**
     * 创建充值订单
     *
     * @param money      需要充值的金额
     * @param ip         IP地址
     *                   //     * @param serialnumber 充值
     *                   //     * @param subject      充值名称，如果不传，默认“充值”
     * @param paymentins 支付方式
     *                   //     * @param bankcode     银行代码
     *                   //     * @param paychannel   支付渠道，主要用作区分是否是信用卡支付功能
     *                   //     * @param clienttype   客户端
     *                   //     * @param ext          扩展内容
     * @return
     */
    public Observable<PackResponse> createRechargeOrder(String money, String ip, String paymentins) {

        return mSellApi.createRechargeOrder(URL_CREATE_RECHARGE_ORDER, money, ip, "", "充值", paymentins, "", "", "android", SellApplication.getACache().getAsString(Constant.ACacheTag.PAYACCOUNTID)
        ).compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    /**
     * 获取支付参数
     */
    public Observable<AliPayResponse> getAlipayParams(String id) {

        return mSellApi.getAlipayParams(URL_GET_ALIPAY_PARAMS, id).compose(TransformUtils.<AliPayResponse>defaultSchedulers());
    }

    /**
     * 生成微信预付款订单
     *
     * @param id 支付流ID
     *           //     * @param tradetype   交易类型
     *           //     * @param deviceinfo   设备号
     *           //     * @param spbillcreateip  终端IP
     *           //     * @param openid         用户标记
     *           //     * @param companyid   公司ID
     *           //     * @param tradenum    交易号
     */
    public Observable<WeixinPayResponse> getWXorderId(String id) {
        return mSellApi.getWXorderId(URL_GET_WEIXIN_ORDER_ID, id, "APP", "APP_OODSO")
                .compose(TransformUtils.<WeixinPayResponse>defaultSchedulers());
    }

    /**
     * 生成微信支付的JSAPI参数
     *
     * @param prepayid 微信支付预订单号
     *                 //     * @param companyid   公司ID
     */
    public Observable<WeixinPayResponse> getWXPayParm(String prepayid) {

        return mSellApi.getWXPayParm(URL_GET_WEIXIN_PARM, prepayid, "APP_OODSO")
                .compose(TransformUtils.<WeixinPayResponse>defaultSchedulers());
    }


    /**
     * 获取用户押金列表
     */
    public Observable<DepositListBean> getDepositList(String pagenum, String size, String status, String loadtotalamount) {

        return mSellApi.getDeoisit(URL_GET_DEPOSIT_LIST, pagenum, size, status, SellApplication.getACache().getAsString(Constant.ACacheTag.PAYACCOUNTID), loadtotalamount)
                .compose(TransformUtils.<DepositListBean>defaultSchedulers());
    }

    /**
     * 获取押金金额
     *
     * @return
     */
    public Observable<DepositMoneyType> getDepositMoney() {

        return mSellApi.getDeoisitMoney(URL_GET_DEPOSIT_MONEY, SellApplication.getACache().getAsString(Constant.ACacheTag.PAYACCOUNTID))
                .compose(TransformUtils.<DepositMoneyType>defaultSchedulers());
    }


    public Observable<PackResponse> getReturnMoney(String depositid) {

        return mSellApi.getReturnMoney(URL_RETURN_DEPOIST, depositid, SellApplication.getACache().getAsString(Constant.ACacheTag.PAYACCOUNTID))
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }


    /**
     * 获取支付单列表
     *
     * @param pagenum
     * @param pagesize
     * @param direction 1(支出） 0（收入）
     * @return
     */
    public Observable<PaymentMoneyListBean> getPayAccountInfo(String pagenum, String pagesize, String direction) {

        return mSellApi.getPaymentList(URL_PAYMENTS_ORDERS_GET, pagenum, pagesize, direction, SellApplication.getACache().getAsString(Constant.ACacheTag.PAYACCOUNTID))
                .compose(TransformUtils.<PaymentMoneyListBean>defaultSchedulers());
    }

    /**
     * 获取seller_id
     * associatedaccountid  shopid
     * contenttype  传SHOP
     *
     * @return
     */
    public Observable<ShopUniquesellerIdBean> getUniquessellerid(String shopid) {

        return mSellApi.getUniquessellerid(URL_USER_UNIQUESSELLERID_GET, shopid, "SHOP")
                .compose(TransformUtils.<ShopUniquesellerIdBean>defaultSchedulers());
    }

    /**
     * 获取支付密码设置状态
     */
    public Observable<PayAccountInfoBean> getPayAccountInfo(String payaccountid) {

        return mSellApi.getPayAccountInfo(URL_PAYACCOUNT_GET, payaccountid)
                .compose(TransformUtils.<PayAccountInfoBean>defaultSchedulers());
    }

    /**
     * 设置支付密码
     */
    public Observable<NumberReponseBean> payPasswordSet(String payaccountid, String password, String code) {
        String encrypt = "";
        try {
            encrypt = AESOperatorUtil.getInstance().encrypt(password);
            encrypt = encrypt.replace('+', '*').replace('/', '-').replace('=', '.');
        } catch (Exception e) {
            Log.e("AES Password", e.toString());
        }
        return mSellApi.payPasswordSet(URL_PAYPASSWORD_RESET, payaccountid, encrypt, code)
                .compose(TransformUtils.<NumberReponseBean>defaultSchedulers());
    }

    /**
     * 修改支付密码
     */
    public Observable<NumberReponseBean> payPasswordModify(String payaccountid, String password, String newPassword) {
        String p1 = "";
        String p2 = "";
        try {
            p1 = AESOperatorUtil.getInstance().encrypt(password);
            p1 = p1.replace('+', '*').replace('/', '-').replace('=', '.');
            p2 = AESOperatorUtil.getInstance().encrypt(newPassword);
            p2 = p2.replace('+', '*').replace('/', '-').replace('=', '.');
        } catch (Exception e) {
            Log.e("AES Password", e.toString());
        }
        return mSellApi.payPasswordModify(URL_PAYPASSWORD_MODIFY, payaccountid, p1, p2)
                .compose(TransformUtils.<NumberReponseBean>defaultSchedulers());
    }


    /**
     * 验证支付密码
     */
    public Observable<NumberReponseBean> payPasswordVerify(String payaccountid, String password) {
        String encrypt = "";
        try {
            encrypt = AESOperatorUtil.getInstance().encrypt(password);
            encrypt = encrypt.replace('+', '*').replace('/', '-').replace('=', '.');
        } catch (Exception e) {
            Log.e("AES Password", e.toString());
        }
        return mSellApi.verifyPayPassword(URL_PAYPASSWORD_VERIFY, payaccountid, encrypt)
                .compose(TransformUtils.<NumberReponseBean>defaultSchedulers());
    }


    /**
     * 获取租赁订单
     */
    public Observable<LeaseOrderInfoBean> getLeaseOrder(String pagenum, String pagesize, String status, String lerrossellerid, String orderid, String phone) {
        return mSellApi.getLeaseOrder(LEASE_ORDER_INFO, pagenum, pagesize, status, lerrossellerid, orderid, phone)
                .compose(TransformUtils.<LeaseOrderInfoBean>defaultSchedulers());
    }

    /**
     * 获取租赁商品信息
     */
    public Observable<LeaseGoodsInfoBean> getLeaseOrderInfo(String orderid) {
        return mSellApi.getLeaseGoodsInfo(GET_LEASE_ORDER_INFO, orderid)
                .compose(TransformUtils.<LeaseGoodsInfoBean>defaultSchedulers());
    }

    /**
     * 获取租赁商品价格
     */
    public Observable<LeaseOrderCostBean> getLeaseOrderCost(String leaseId) {
        return mSellApi.getLeaseGoodsCost(GET_LEASE_COST_GET, leaseId)
                .compose(TransformUtils.<LeaseOrderCostBean>defaultSchedulers());
    }


    /**
     * 确认收货
     */
    public Observable<NumberReponseBean> confirmTrade(String tradeId) {
        return mSellApi.tradeConfirm(LEASE_TRADE_CONFIRM, tradeId)
                .compose(TransformUtils.<NumberReponseBean>defaultSchedulers());
    }

    /**
     * 获取聊天列表
     */
    public Observable<RongyunResponse> rongcloudchatlist() {
        return mSellApi.rongcloudchatlist(YUN_IM_RONGCLOUD_REALTIME_CHAT_LIST)
                .compose(TransformUtils.<RongyunResponse>defaultSchedulers());
    }

    /**
     * 获取群组信息
     */
    public Observable<UserResponse> getGroupInfo(String groupId) {
        return mSellApi.getGroupInfo(GROUPINFO_GET, groupId)
                .compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    /**
     * 收藏消息
     */
    public Observable<RongyunResponse> rongcloudchatcollectAdd(String msg_uid) {
        return mSellApi.rongcloudchatcollectAdd(YUN_IM_RONGCLOUD_COLLECT_ADD, msg_uid)
                .compose(TransformUtils.<RongyunResponse>defaultSchedulers());
    }

    /**
     * 删除消息
     */
    public Observable<RongyunResponse> rongcloudchatDelrealtime(String msg_uid) {
        return mSellApi.rongcloudchatDelrealtime(YUN_IM_RONGCLOUD_DELREALTIME_DELETE, msg_uid)
                .compose(TransformUtils.<RongyunResponse>defaultSchedulers());
    }

    /**
     * 获取历史消息
     */
    public Observable<RongyunResponse> rongcloudmsglist(long lastitemtime, int pagesize, String touserid, String channeltype) {
        return mSellApi.rongcloudmsglist(YUN_IM_RONGCLOUD_REALTIME_MSG_LIST, lastitemtime, pagesize, touserid, channeltype)
                .compose(TransformUtils.<RongyunResponse>defaultSchedulers());
    }


    public Observable<SubletListBean> getSubletList() {
        return mSellApi.getSubletList(URL_SUBLET_LIST_GET, SellApplication.getInstance().getShopId())
                .compose(TransformUtils.<SubletListBean>defaultSchedulers());
    }


    //获取转租模板id
    public Observable<PackResponse> getSubletId(String name, String isdefault) {
        return mSellApi.getSubletId(URL_GET_SUBLET_ID, name, isdefault, SellApplication.getInstance().getShopId())
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //添加转租模板
    public Observable<PackResponse> addNewSublet(String proportion, String id) {
        return mSellApi.addSublet(URL_ADD_SUBLET, proportion, id)
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //更新转租模板名
    public Observable<PackResponse> updateSubletName(String id, String name, String isdefault) {
        return mSellApi.updateSubletName(URL_UPDATE_SUBLET_NAME, id, name, isdefault)
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //更新转租模板等级
    public Observable<PackResponse> updateSubletLevel(String proportion, String id) {
        return mSellApi.updateSubletLevel(URL_UPDATE_SUBLET_LEVEL, proportion, id)
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //删除转租模板等级
    public Observable<PackResponse> deleteSubletLevel(String id) {
        return mSellApi.deleteSubletLevel(URL_UPDATE_SUBLET_DELETE, id)
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    /**
     * 删除转租模板。
     *
     * @param id
     * @return
     */
    public Observable<PackResponse> deleteSublet(String id) {
        return mSellApi.deleteSublet(URL_DELETE_SUBLET, id)
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //更新租赁模板
    public Observable<PackResponse> updateSublet(String id, String itemids, String clearoldgoods) {
        return mSellApi.updateSublet(URL_UPDATE_SUBLET, id, itemids, clearoldgoods)
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    /**
     * 获取押金模板
     *
     * @return
     */
    public Observable<DespositBean> getLeaseDeposit() {
        return mSellApi.getLeaseDeposit(URL_LEASE_DEPOSIT_GET, SellApplication.getACache().getAsString(Constant.ACacheTag.NETSHOPID))
                .compose(TransformUtils.<DespositBean>defaultSchedulers());
    }

    /**
     * 设置押金模板
     *
     * @return
     */
    public Observable<NumberReponseBean> setLeaseDeposit(String deposit_amount, String type) {
        return mSellApi.setLeaseDeposit(URL_LEASE_DEPOSIT_SET, deposit_amount, type, SellApplication.getACache().getAsString(Constant.ACacheTag.NETSHOPID))
                .compose(TransformUtils.<NumberReponseBean>defaultSchedulers());
    }

    /**
     * 获取待结算列表
     *
     * @return
     */
    public Observable<FinancilaRecordList> financialRecordList(String pagenum, String pagesize) {
        return mSellApi.financialRecordList(URL_SHOP_FINANCIAL_RECORD, pagenum, pagesize, "PAID")
                .compose(TransformUtils.<FinancilaRecordList>defaultSchedulers());
    }

    /**
     * token登录
     */
    public Observable<UserResponse> getTokenLogin() {
        return mSellApi.getTokenLogin(USER_TOKENLOGIN, DeviceInfoUtils.getDeviceId())
                .compose(TransformUtils.<UserResponse>defaultSchedulers());
    }

    public Observable<NewAuthInfoBean> getAuthInfo() {
        return mSellApi.getAuthInfo(GETAUTNINFO, SellApplication.getACache().getAsString(Constant.ACacheTag.USER_SELLER_ID))
                .compose(TransformUtils.<NewAuthInfoBean>defaultSchedulers());
    }

    public Observable<H5URLBean> getUrl(String num, String module_flag) {
        return mSellApi.getUrl(LocationCouponURL, num, module_flag)
                .compose(TransformUtils.<H5URLBean>defaultSchedulers());
    }

    //获取不同平台的sercet
    public Observable<PlatformSercetBean> getPlatformSercet(String name) {
        return mSellApi.getPlatformSercet(GET_PLATFORM_SERCET, name)
                .compose(TransformUtils.<PlatformSercetBean>defaultSchedulers());
    }

    //获取不同平台列表
    public Observable<PlatformListBean> getPlatformList(String pnum, String psize) {
        return mSellApi.getPlatformList(GET_PLATFORM_LIST, pnum, psize)
                .compose(TransformUtils.<PlatformListBean>defaultSchedulers());
    }

    //获取商品展示平台列表
    public Observable<PlatformBean> getChilcAppInfoList() {
        return mSellApi.getChildAppInfoList(CHILD_APP_INFO_GET)
                .compose(TransformUtils.<PlatformBean>defaultSchedulers());
    }


    //erp仓库模块
    //获取仓库列表
    public Observable<WareHouseBean> getWareHouseList(String pagenum, String pagesize, String warehouse_type, String warehouse_name, String contacts, String fields, String telephone) {
        return mSellApi.getWarehouseList(ERP_GET_WAREHOUSE_LIST, pagenum, pagesize, warehouse_type, warehouse_name, contacts, fields, telephone)
                .compose(TransformUtils.<WareHouseBean>defaultSchedulers());
    }


    /**
     * 添加仓库
     *
     * @param contacts         联系人
     * @param telephone        电话
     * @param email            邮件
     * @param q_q              qq
     * @param weixin           微信
     * @param is_enabled       是否启用
     * @param store_id         门店id
     * @param warehouse_name   仓库名称
     * @param warehouse_number 仓库编号
     * @param warehouse_type   仓库类型
     * @return
     */
    public Observable<AddWarehouseBean> turnToAddWarehouse(String contacts, String telephone,
                                                           String email,
                                                           String q_q, String weixin, String is_enabled,
                                                           String store_id, String warehouse_name,
                                                           String warehouse_number,
                                                           String warehouse_type) {
        return mSellApi.turnToAddWarehouse(ERP_ADD_WAREHOUSE, contacts, telephone, email, q_q, weixin, is_enabled, store_id, warehouse_name, warehouse_number, warehouse_type)
                .compose(TransformUtils.<AddWarehouseBean>defaultSchedulers());
    }

    //删除仓库
    public Observable<PlatformBean> turnToDeleteWarehouse(String id) {
        return mSellApi.turnToDeleteWarehouse(ERP_DELETE_WAREHOUSE, id)
                .compose(TransformUtils.<PlatformBean>defaultSchedulers());
    }

    /**
     * 更新仓库信息
     *
     * @param contacts         联系人
     * @param telephone        电话
     * @param email            邮件
     * @param q_q              qq
     * @param weixin           微信
     * @param is_enabled       是否启用
     * @param store_id         门店id
     * @param warehouse_name   仓库名称
     * @param warehouse_number 仓库编号
     * @param warehouse_type   仓库类型
     * @return
     */
    public Observable<PlatformBean> turnToUpdateWarehouse(String contacts, String telephone,
                                                          String email,
                                                          String q_q, String weixin, String is_enabled,
                                                          String store_id, String warehouse_name,
                                                          String warehouse_number, String warehouse_contacts,
                                                          String warehouse_type) {
        return mSellApi.turnToUpdateWarehouse(ERP_UPDATE_WAREHOUSE, contacts, telephone, email, q_q, weixin, is_enabled, store_id, warehouse_name, warehouse_number, warehouse_contacts, warehouse_type)
                .compose(TransformUtils.<PlatformBean>defaultSchedulers());
    }

    //获取仓库详情
    public Observable<PlatformBean> getWarehouseDetail(String id, String fields) {
        return mSellApi.turnToGetWarehouseDetail(ERP_GET_WAREHOUSE_DETAIL, id, fields)
                .compose(TransformUtils.<PlatformBean>defaultSchedulers());
    }


    //锁定仓库
    public Observable<PlatformBean> lockWarehouse(String id, String is_lock) {
        return mSellApi.turnToWarehouseLock(ERP_GET_WAREHOUSE_DETAIL, id, is_lock)
                .compose(TransformUtils.<PlatformBean>defaultSchedulers());
    }


    //erp门店模块
    //获取门店列表
    public Observable<StoreListBean> getStoreList(String pagenum, String pagesize, String storename, String storecontacts, String storephone, String fields) {
        return mSellApi.getStoreList(ERP_GET_STORE_LIST, pagenum, pagesize, storename, storecontacts, storephone, fields)
                .compose(TransformUtils.<StoreListBean>defaultSchedulers());
    }


    //添加门店
    public Observable<AddStoreBean> turnToAddStore(String storename, String storenumber,
                                                   String address,
                                                   String province, String city,
                                                   String town, String area,
                                                   String contacts, String telephone,
                                                   String email, String qq,
                                                   String weixin, String isenabled,
                                                   String issyslevel, String isopenwarehouse,
                                                   String housename, String housecode,
                                                   String housecontacts, String housetelephone,
                                                   String houseemail, String houseqq,
                                                   String houseweixin, String houseisenabled) {
        return mSellApi.turnToAddStore(ERP_ADD_STORE, storename, storenumber, address, province, city, town, area, contacts, telephone, email, qq,
                weixin, isenabled, issyslevel, isopenwarehouse, housename, housecode, housecontacts, housetelephone, houseemail, houseqq, houseweixin, houseisenabled)
                .compose(TransformUtils.<AddStoreBean>defaultSchedulers());
    }

    //删除门店
    public Observable<DeleteStoreBean> turnToDeleteStore(String id) {
        return mSellApi.turnToDeleteStore(ERP_DELETE_STORE, id)
                .compose(TransformUtils.<DeleteStoreBean>defaultSchedulers());
    }

    //更新门店信息
    public Observable<UpdateStoreBean> turnToUpdateStore(String storeid, String storename, String storenumber,
                                                         String address,
                                                         String province, String city,
                                                         String town, String area,
                                                         String contacts, String telephone,
                                                         String email, String qq,
                                                         String weixin, String isenabled,
                                                         String issyslevel, String isopenwarehouse,
                                                         String housename, String housecode,
                                                         String housecontacts, String housetelephone,
                                                         String houseemail, String houseqq,
                                                         String houseweixin, String houseisenabled) {
        return mSellApi.turnToUpdateStore(ERP_UPDATE_STORE, storeid, storename, storenumber, address, province, city, town, area, contacts, telephone, email, qq,
                weixin, isenabled, issyslevel, isopenwarehouse, housename, housecode, housecontacts, housetelephone, houseemail, houseqq, houseweixin, houseisenabled)
                .compose(TransformUtils.<UpdateStoreBean>defaultSchedulers());
    }

    //获取门店详情
    public Observable<StoreDetailBean> getStoreDetail(String id, String fields) {
        return mSellApi.turnToGetStoreDetail(ERP_GET_STORE_DETAIL, id, fields)
                .compose(TransformUtils.<StoreDetailBean>defaultSchedulers());
    }

    //获取平台是否需要审核商品
    public Observable<WebSettingBean> getSiteConfig() {
        return mSellApi.getSiteConfig(URL_SITE_CONFIG_GET)
                .compose(TransformUtils.<WebSettingBean>defaultSchedulers());
    }

    //获取itemcat详情
    public Observable<ItemCatDetaileBean> getItemcatDetail(String item_cat_id, String shop_id) {
        return mSellApi.getItemcatDetial(GET_ITEMCAT_DETAILS, item_cat_id, shop_id)
                .compose(TransformUtils.<ItemCatDetaileBean>defaultSchedulers());
    }

    //获取子账号详情
    public Observable<ChildIdDetailBean> getChildIdDetail(String id) {
        return mSellApi.getChildIdDetial(GET_CHILD_DETAIL, id)
                .compose(TransformUtils.<ChildIdDetailBean>defaultSchedulers());
    }

    //获取子账号列表
    public Observable<ChildListBean> getChildIdList(String pagenum, String pagesize) {
        return mSellApi.getChildIdList(GET_CHILD_LIST, pagenum, pagesize)
                .compose(TransformUtils.<ChildListBean>defaultSchedulers());
    }

    //添加子账号
    public Observable<PackResponse> turntoAddChildId(String userName, String pwd, String display_name, String phone, String is_female, String qq, String wei_xin, String is_enabled) {
        return mSellApi.turntoAddChildId(ADD_CHILD_ID, userName, pwd, display_name, phone, is_female, qq, wei_xin, is_enabled, "true", "true")
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //更新子账号
    public Observable<PackResponse> turntoUpdateChildId(String id, String userName, String pwd, String display_name, String phone, String is_female, String qq, String wei_xin, String is_enabled) {
        return mSellApi.turntoUpdateChildId(UPDATE_CHILD_ID, id, userName, pwd, display_name, phone, is_female, qq, wei_xin, is_enabled, "true", "true")
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //获取默认的shopid
    public Observable<GetDefaultShopidBean> turntoGetShopId() {
        return mSellApi.getShopId(GET_DEFAULT_SHOPID)
                .compose(TransformUtils.<GetDefaultShopidBean>defaultSchedulers());
    }

    //获取团购列表
    public Observable<GroupItemBean> getGroupPurchaseList(String pagenum, String pagesize, String status) {
        return mSellApi.getGroupPurchaseList(GROUPBUY_LIST, pagenum, pagesize, status, SellApplication.getInstance().getShopId())
                .compose(TransformUtils.<GroupItemBean>defaultSchedulers());
    }

    //创建拼团活动
    public Observable<PackResponse> turntoAddGroupbuy(String name, String des, String usertype, String ext, String starttime, String endtime) {
        return mSellApi.addGroupbuy(ADD_GROUPBUY, name, des, usertype, ext, SellApplication.getInstance().getShopId(), SellApplication.getACache().getAsString(Constant.ACacheTag.SHOPCOMPANYID), starttime, endtime)
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //将商品加入团购活动中并进行相关的设置
    public Observable<PackResponse> turntoAddGoods(String activityid, String item_content, String remove_original_record) {
        return mSellApi.addGoods(ADD_GOODS, activityid, item_content, remove_original_record)
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //获取团购详情
    public Observable<GroupDetailBean> turntoGetGroupDetail(String activityid) {
        return mSellApi.getGroupDetail(GET_GROUPBUY_INFO, activityid, "1", "1")
                .compose(TransformUtils.<GroupDetailBean>defaultSchedulers());
    }

    //删除团购活动
    public Observable<PackResponse> turntoDeleteGroup(String activityid) {
        return mSellApi.deleteGroup(DELETE_GROUPBUY, activityid)
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //结束团购活动
    public Observable<PackResponse> turntoEndGroup(String activityid) {
        return mSellApi.endGroup(END_GROUPBUY, activityid)
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //更新团购内容
    public Observable<GroupDetailBean> turntoUpdateGroupBuy(String activityid, String name, String des, String usertype, String ext, String starttime, String endtime) {
        return mSellApi.updateGroupBuy(UPDATE_GROUPBUY, activityid, name, des, usertype, ext, SellApplication.getInstance().getShopId(), SellApplication.getACache().getAsString(Constant.ACacheTag.SHOPCOMPANYID), starttime, endtime)
                .compose(TransformUtils.<GroupDetailBean>defaultSchedulers());
    }

    //------满赠------
    //新增满就送/折扣/减活动
    public Observable<RewardBean> rewardAdd(String name, String participate_range, String participate_range_id, String start_time, String end_time, String activity_content, String ext) {
        return mSellApi.rewardAdd(REWARD_ADD, name, participate_range, participate_range_id, start_time, end_time, activity_content, ext, SellApplication.getInstance().getShopId(), SellApplication.getACache().getAsString(Constant.ACacheTag.SHOPCOMPANYID))
                .compose(TransformUtils.<RewardBean>defaultSchedulers());
    }

    //更新满就送/折扣/减活动
    public Observable<RewardBean> updateReward(String activityid, String name, String participate_range, String participate_range_id, String start_time, String end_time, String activity_content, String ext) {
        return mSellApi.updateReward(MJS_ACTIVITY_UPDATE, activityid, name, participate_range, participate_range_id, start_time, end_time, activity_content, ext, SellApplication.getInstance().getShopId(), SellApplication.getACache().getAsString(Constant.ACacheTag.SHOPCOMPANYID))
                .compose(TransformUtils.<RewardBean>defaultSchedulers());
    }

    //获取满赠列表
    public Observable<GetRewardListBean> getRewardList(String pagenum, String status) {
        return mSellApi.getRewardList(MJS_ACTIVITY_LIST_GET, pagenum, "10", "", status, SellApplication.getInstance().getShopId(), SellApplication.getACache().getAsString(Constant.ACacheTag.SHOPCOMPANYID))
                .compose(TransformUtils.<GetRewardListBean>defaultSchedulers());
    }

    //获取满赠活动详情
    public Observable<RewardDetailBean> getRewardDetail(String activityid) {
        return mSellApi.getRewardDetail(MJS_ACTIVITY_GET, activityid)
                .compose(TransformUtils.<RewardDetailBean>defaultSchedulers());
    }

    //删除满赠活动
    public Observable<PackResponse> deleteReward(String activityid) {
        return mSellApi.deleteReward(MJS_ACTIVITY_DELETE, activityid)
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //删除满赠活动
    public Observable<PackResponse> endReward(String activityid) {
        return mSellApi.endReward(MJS_ACTIVITY_END, activityid)
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //获取文章分类列表
    public Observable<PackResponse> getClassfication() {
        return mSellApi.getClassfication(URL_GET_AITICLE_CLASS, "", "", "", "", "", "", "")
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //添加文章
    public Observable<PackResponse> addArticle(String title, String detail, String tags, String sort, String comment_status, String password, String post_meta,
                                               String status, String goods_id, String visits, String post_time, String custom_type, String thumb, String summary) {
        return mSellApi.addArticle(URL_ADD_ARTICLE, title, detail, tags, sort, comment_status, password, post_meta,
                status, goods_id, visits, post_time, custom_type, thumb, summary, SellApplication.getInstance().getShopId())
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //添加文章
    public Observable<PackResponse> updateArticle(String id, String title, String detail, String tags, String sort, String comment_status, String password, String post_meta,
                                                  String status, String goods_id, String visits, String post_time, String custom_type, String thumb, String summary) {
        return mSellApi.updateArticle(URL_UPDATE_ARTICLE, id, title, detail, tags, sort, comment_status, password, post_meta,
                status, goods_id, visits, post_time, custom_type, thumb, summary, SellApplication.getInstance().getShopId())
                .compose(TransformUtils.<PackResponse>defaultSchedulers());
    }

    //获取文章详情
    public Observable<AritcleDetailBean> getArticleDetail(String id, String fields) {
        return mSellApi.getAritcleDetail(URL_GET_ARTICLE_DETAIL, id, fields)
                .compose(TransformUtils.<AritcleDetailBean>defaultSchedulers());
    }

    //获取文章列表
    public Observable<ArticleListBean> getArticlelist(String pagenum, String pagesize) {
        return mSellApi.getAritcles(URL_GET_ARTICLES, pagenum, pagesize, SellApplication.getInstance().getShopId())
                .compose(TransformUtils.<ArticleListBean>defaultSchedulers());
    }

    //删除文章
    public Observable<ArticleListBean> delArticle(String id) {
        return mSellApi.delAritcle(URL_DEL_ARTICLES, id)
                .compose(TransformUtils.<ArticleListBean>defaultSchedulers());
    }
}
